package com.example.telesys.service;

import com.example.telesys.interceptor.FeignPassToken;
import com.example.telesys.pojo.Customerorder;
import com.example.telesys.service.fallback.CustomerorderServiceFallback;
import com.example.telesys.service.fallback.CustomerorderServiceFallbackFactory;
import com.github.pagehelper.PageInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(
        value = "service-customerorder",
        configuration = FeignPassToken.class,
//        fallback = CustomerorderServiceFallback.class
        fallbackFactory = CustomerorderServiceFallbackFactory.class
)
public interface CustomerorderService {

    @RequestMapping("/customerorder/insertPhoneOrder")
    int insertPhoneOrder(@RequestBody Customerorder customerorder);

    @RequestMapping("/customerorder/selectMyOrders")
    PageInfo selectMyOrders(
            @RequestParam("username") String username,
            @RequestParam("currentPageNumber") Integer currentPageNumber,
            @RequestParam("currentPageSize") Integer currentPageSize);

    @RequestMapping("/customerorder/insertBroadbandOrder")
    int insertBroadbandOrder(@RequestBody Customerorder order);

    @RequestMapping("/customerorder/insertTrafficOrder")
    int insertTrafficOrder(@RequestBody Customerorder order);
}
